package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Publicdurg {
    private int publicdurgId;
    private Long publicdurgShuliang;
    private Long publicdurgShijishuliang;
    private Long publicdurgType;
    private Long publicdurgAllmoney;
    private String publicdurgPeope;
    private String publicdurgLingyaopeople;
    private Collection<PublicdurgDetails> publicdurgDetailsByPublicdurgId;

    @Id
    @Column(name = "publicdurg_id", nullable = false)
    public int getPublicdurgId() {
        return publicdurgId;
    }

    public void setPublicdurgId(int publicdurgId) {
        this.publicdurgId = publicdurgId;
    }

    @Basic
    @Column(name = "publicdurg_shuliang", nullable = true, precision = 0)
    public Long getPublicdurgShuliang() {
        return publicdurgShuliang;
    }

    public void setPublicdurgShuliang(Long publicdurgShuliang) {
        this.publicdurgShuliang = publicdurgShuliang;
    }

    @Basic
    @Column(name = "publicdurg_shijishuliang", nullable = true, precision = 0)
    public Long getPublicdurgShijishuliang() {
        return publicdurgShijishuliang;
    }

    public void setPublicdurgShijishuliang(Long publicdurgShijishuliang) {
        this.publicdurgShijishuliang = publicdurgShijishuliang;
    }

    @Basic
    @Column(name = "publicdurg_type", nullable = true, precision = 0)
    public Long getPublicdurgType() {
        return publicdurgType;
    }

    public void setPublicdurgType(Long publicdurgType) {
        this.publicdurgType = publicdurgType;
    }

    @Basic
    @Column(name = "publicdurg_allmoney", nullable = true, precision = 0)
    public Long getPublicdurgAllmoney() {
        return publicdurgAllmoney;
    }

    public void setPublicdurgAllmoney(Long publicdurgAllmoney) {
        this.publicdurgAllmoney = publicdurgAllmoney;
    }

    @Basic
    @Column(name = "publicdurg_peope", nullable = true, length = 30)
    public String getPublicdurgPeope() {
        return publicdurgPeope;
    }

    public void setPublicdurgPeope(String publicdurgPeope) {
        this.publicdurgPeope = publicdurgPeope;
    }

    @Basic
    @Column(name = "publicdurg_lingyaopeople", nullable = true, length = 30)
    public String getPublicdurgLingyaopeople() {
        return publicdurgLingyaopeople;
    }

    public void setPublicdurgLingyaopeople(String publicdurgLingyaopeople) {
        this.publicdurgLingyaopeople = publicdurgLingyaopeople;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Publicdurg that = (Publicdurg) o;
        return publicdurgId == that.publicdurgId &&
                Objects.equals(publicdurgShuliang, that.publicdurgShuliang) &&
                Objects.equals(publicdurgShijishuliang, that.publicdurgShijishuliang) &&
                Objects.equals(publicdurgType, that.publicdurgType) &&
                Objects.equals(publicdurgAllmoney, that.publicdurgAllmoney) &&
                Objects.equals(publicdurgPeope, that.publicdurgPeope) &&
                Objects.equals(publicdurgLingyaopeople, that.publicdurgLingyaopeople);
    }

    @Override
    public int hashCode() {
        return Objects.hash(publicdurgId, publicdurgShuliang, publicdurgShijishuliang, publicdurgType, publicdurgAllmoney, publicdurgPeope, publicdurgLingyaopeople);
    }

    @OneToMany(mappedBy = "publicdurgByPublicdurgId")
    public Collection<PublicdurgDetails> getPublicdurgDetailsByPublicdurgId() {
        return publicdurgDetailsByPublicdurgId;
    }

    public void setPublicdurgDetailsByPublicdurgId(Collection<PublicdurgDetails> publicdurgDetailsByPublicdurgId) {
        this.publicdurgDetailsByPublicdurgId = publicdurgDetailsByPublicdurgId;
    }
}
